package com.parking.stall.service.call;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.parking.common.core.model.PageInfo;
import com.parking.stall.entity.StallInfo;
import lombok.Data;
import org.springframework.stereotype.Component;

/**
 * pageInfoCheck:分页信息（当前页，当前页数）设置,工具包
 */
@Component
@Data
public class PageInfoCheck {
//    private Object T;

    /**
     * currentSet：当前页设置
     * @param current1:传入的当前页---参数
     * @return current：设置好的当前页
     */
    public Long currentSet(Long current1){
        //分页参数查询判断
        Long current =null;

        if (current1==null||current1==0) {
            current =1L;
        }else {
            current =current1;
        }
        return current;
    }

    /**
     * sizeSet：当前页数设置
     * @param size1:传入的当前页数---参数
     * @return size：设置好的当前页数
     */
    public Long sizeSet(Long size1){
        Long size =null;
        if (size1==null||size1==0) {
            size =3L;
        }else {
            size =size1;
        }
        return size;
    }

//    public PageInfo pageInfoSetParam (Page<T> tPage)throws Exception{
//        PageInfo pageInfo = new PageInfo();
//        return pageInfo;
//    }

}
